System, method and program product to manage installation of programs

ABSTRACT

A system, method and computer program product for controlling execution of a script program programmed to install a computer program is disclosed. An installation computer begins execution of the script program, and before a line or stanza of the script program is executed to initiate installation of the computer program, the installation computer determines that the line or stanza is programmed to initiate installation of the computer program. In response, the installation computer determines if the computer program is already installed. If the computer program is already installed, the installation computer skips the line or stanza of the script program so the script program will not attempt to install the computer program. However, if not, the installation computer continues to execute the script program including the line or stanza programmed to initiate installation of the computer program, such that the script program attempts to install the computer program.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates generally to a computer implementedmethod, data processing system, and computer program product forinstalling computer programs.

2. Description of the Related Art

Installation of new software, fixes and upgrades is a routine processthat in a business environment is expected to occur without incidents.In other words, at a minimum, an installation of software should occurwith little, if any, downtime. In addition, it is preferred that partsof the install process, and even precursor steps to the install process,are not re-executed—or if re-executed, are done while minimizing workperformed by a person supervising the process.

Installation scripts, or install scripts, can be written for a genericor assumed configuration of a data processing system. An install scriptis a stored set of machine readable instructions that, when executed,reconfigure a computer to have a program stored to a file system, andspecifically, to be within the executable path of one or moredirectories that are searched for executable files. Further preparatoryreconfigurations may occur. For example, a computer executing theinstall script may change permissions and ownership for the program,create new file systems and directories, add new user accounts, and thelike.

U.S. Pat. No. 6,598,225, to Curtis, provided installation assistance bysupporting a programmer knowledgeable in writing install programs towrite an install program that is applicable across multiple operatingsystems and environments. Among Curtis's embodiments is an installertool kit based in use of Java™. Java is a trademark of Oracle, Inc. inthe United States, other countries, or both.

U.S. Pat. No. 7,210,143, to Or, provided a two part installation formultitier applications. Or, by applying an application model, includedstatic descriptions of the application and a run-time description of theapplication. Static descriptions include identification of the packagesthat make up the application, identification of specific installationsof the packages and/or a description of static installationdependencies. The run-time description includes identification ofmanaged services, identification of specific configurations of themanaged services and/or run-time dependencies.

It was also known for an installation program to automatically installone or more programs in a computer. If either or both of these programsare currently installed in the computer, the installation program willdelete the current copy of the program and install another copy of theprogram.

It was also known for an installation program to be programmed toautomatically install one or more programs in a computer, but before theinstallation commences to query a configuration file of the computer todetermine if any of the programs are already installed in the computer.If any of the programs are already installed in the computer, Orreplaced the package or program. This way, if a package is alreadyinstalled (or-pre-installed) and an update of the package is laterchecked-in, the updated package can be automatically installed (orpre-installed) in place of the previous version of the package. Withpre-install, as described by Or, packages are pre-installed and theinstallation is completed post-cutover. In one approach, packages arepre-installed at a temporary location on the target device and thenmoved to the final destination post-cutover.

An object of the present invention is to improve the process ofselectively installing computer programs.

SUMMARY OF THE INVENTION

The present invention resides in a system, method and computer programproduct for controlling execution of a script program programmed toinstall a computer program. An installation computer begins execution ofthe script program, and before a line or stanza of the script program isexecuted to initiate installation of the computer program, theinstallation computer determines that the line or stanza is programmedto initiate installation of the computer program. In response, theinstallation computer determines if the computer program is alreadyinstalled. If the computer program is already installed, theinstallation computer skips the line or stanza of the script program sothe script program will not attempt to install the computer program.However, if the computer program is not already installed, theinstallation computer continues to execute the script program includingthe line or stanza programmed to initiate installation of the computerprogram, such that the script program attempts to install the computerprogram.

BRIEF DESCRIPTION OF THE DRAWINGS

The novel features believed characteristic of the invention are setforth in the appended claims. The invention itself, however, as well asa preferred mode of use, further objectives and advantages thereof, willbest be understood by reference to the following detailed description ofan illustrative embodiment when read in conjunction with theaccompanying drawings, wherein:

FIG. 1 is a block diagram of a data processing system in accordance withan illustrative embodiment of the invention;

FIG. 2 is a configuration of an installer engine in accordance with anillustrative embodiment of the invention;

FIG. 3 is a description of reserved words and allowable commands of aconfiguration script in accordance with an illustrative embodiment ofthe invention;

FIG. 4A is a main grouping of stanzas in accordance with an illustrativeembodiment of the invention;

FIG. 4B is an install stanza in accordance with an illustrativeembodiment of the invention;

FIGS. 5A-5C show flowcharts of an install engine optionally haltingprogress to wait for human remedial action in accordance with anillustrative embodiment of the invention; and

FIGS. 6A-6C show an example of an script program that is interpreted inaccordance with an illustrative embodiment of the invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

With reference now to the figures and in particular with reference toFIG. 1, a block diagram of a data processing system is shown in whichaspects of an illustrative embodiment may be implemented. Dataprocessing system 100 is an example of a computer, in which code orinstructions implementing the processes of the present invention may belocated. In the depicted example, data processing system 100 employs ahub architecture including a north bridge and memory controller hub(NB/MCH) 102 and a south bridge and input/output (I/O) controller hub(SB/ICH) 104. A north bridge is a chipset that facilitates communicationbetween the processor and main memory. A south bridge is a chipset thatfacilitates communications from processor to and among drives and otherperipherals. Processor 106, main memory 108, and graphics processor 110connect to north bridge and memory controller hub 102. Graphicsprocessor 110 may connect to the NB/MCH through an accelerated graphicsport (AGP), for example.

In the depicted example, local area network (LAN) adapter 112 connectsto south bridge and I/O controller hub 104 and audio adapter 116,keyboard and mouse adapter 120, modem 122, read only memory (ROM) 124,hard disk drive (HDD) 126, CD-ROM drive 130, universal serial bus (USB)ports and other communications ports 132, and PCI/PCIe devices 134connect to south bridge and I/O controller hub 104 through bus 138 andbus 140. PCI/PCIe devices may include, for example, Ethernet adapters,add-in cards, and PC cards for notebook computers. PCI uses a card buscontroller, while PCIe does not. ROM 124 may be, for example, a flashbinary input/output system (BIOS). Hard disk drive 126 and CD-ROM drive130 may use, for example, an integrated drive electronics (IDE) orserial advanced technology attachment (SATA) interface. A super I/O(SIO) device 136 may be connected to south bridge and I/O controller hub104.

An operating system runs on processor 106, and coordinates and providescontrol of various components within data processing system 100 inFIG. 1. The operating system may be a commercially available operatingsystem such as Microsoft® Windows® XP. Microsoft and Windows aretrademarks of Microsoft Corporation in the United States, othercountries, or both. An object oriented programming system, such as theJava programming system, may run in conjunction with the operatingsystem and provides calls to the operating system from Java programs orapplications executing on data processing system 100.

Instructions for the operating system, the object-oriented programmingsystem, and applications or programs are located on computer readabletangible storage devices, such as hard disk drive 126, and may be loadedinto main memory 108 for execution by processor 106. The processes ofthe present invention can be performed by processor 106 using computerimplemented instructions, which may be located in a memory such as, forexample, main memory 108, read only memory 124, or in one or moreperipheral devices.

Those of ordinary skill in the art will appreciate that the hardware inFIG. 1 may vary depending on the implementation. Other internal hardwareor peripheral devices, such as flash memory, equivalent non-volatilememory, and the like, may be used in addition to or in place of thehardware depicted in FIG. 1. In addition, the processes of theillustrative embodiments may be applied to a multiprocessor dataprocessing system.

In some illustrative examples, data processing system 100 may be apersonal digital assistant (PDA), which is configured with flash memoryto provide non-volatile memory for storing operating system files and/oruser-generated data. A bus system may be comprised of one or more buses,such as a system bus, an I/O bus, and a PCI bus. Of course, the bussystem may be implemented using any type of communications fabric orarchitecture that provides for a transfer of data between differentcomponents or devices attached to the fabric or architecture. Acommunication unit may include one or more devices used to transmit andreceive data, such as a modem or a network adapter. A memory may be, forexample, main memory 108 or a cache such as found in north bridge andmemory controller hub 102. A processing unit may include one or moreprocessors or CPUs. The depicted example in FIG. 1 is not meant to implyarchitectural limitations. For example, data processing system 100 alsomay be a tablet computer, laptop computer, or telephone device inaddition to taking the form of a PDA.

The description of the present invention has been presented for purposesof illustration and description, but is not intended to be exhaustive orlimited to the invention in the form disclosed. Many modifications andvariations will be apparent to those of ordinary skill in the artwithout departing from the scope and spirit of the invention. Theembodiment was chosen and described in order to best explain theprinciples of the invention and the practical application, and to enableothers of ordinary skill in the art to understand the invention forvarious embodiments with various modifications as are suited to theparticular use contemplated.

As will be appreciated by one skilled in the art, aspects of the presentinvention may be embodied as a system, method or computer programproduct. Accordingly, aspects of the present invention may take the formof an entirely hardware embodiment, an entirely software embodiment(including firmware, resident software, micro-code, etc.) or anembodiment combining software and hardware aspects that may allgenerally be referred to herein as a “circuit,” “module” or “system.”Furthermore, aspects of the present invention may take the form of acomputer program product embodied in one or more computer readabledevice(s) having computer readable program code embodied thereon.

Any combination of one or more computer readable device(s) may beutilized. Examples of a computer readable tangible storage deviceinclude a portable computer diskette, a hard disk, a random accessmemory (RAM), a read-only memory (ROM), an erasable programmableread-only memory (EPROM or Flash memory), a portable compact discread-only memory (CD-ROM), an optical storage device, a magnetic storagedevice, or any suitable combination of the foregoing. In the context ofthis document, a computer readable storage device may be any tangibledevice that can store a program for use by or in connection with aninstruction execution system, apparatus, or device. The term“computer-readable storage device” does not encompass a signalpropagation media examples of which include a copper cable, opticalfiber or wireless transmission media.

Computer program code for carrying out operations for aspects of thepresent invention may be written in any combination of one or moreprogramming languages, including an object oriented programming languagesuch as Java, Smalltalk, C++ or the like and conventional proceduralprogramming languages, such as the “C” programming language or similarprogramming languages. The program code may execute entirely on theuser's computer, partly on the user's computer, as a stand-alonesoftware package, partly on the user's computer and partly on a remotecomputer or entirely on the remote computer or server. In the latterscenario, the remote computer may be connected to the user's computerthrough any type of network, including a local area network (LAN) or awide area network (WAN), or the connection may be made to an externalcomputer (for example, through the Internet using an Internet ServiceProvider).

Aspects of the present invention are described below with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems) and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer program instructions. These computer program instructions maybe provided to a processor of a general purpose computer, specialpurpose computer, or other programmable data processing apparatus toproduce a machine, such that the instructions, which execute via theprocessor of the computer or other programmable data processingapparatus, create means for implementing the functions/acts specified inthe flowchart and/or block diagram block or blocks.

These computer program instructions may also be stored in a computerreadable device that can direct a computer, other programmable dataprocessing apparatus, or other devices to function in a particularmanner, such that the instructions stored in the computer readabledevice produce an article of manufacture including instructions whichimplement the function/act specified in the flowchart and/or blockdiagram block or blocks.

The computer program instructions may also be loaded onto a computer,other programmable data processing apparatus, or other devices to causea series of operational steps to be performed on the computer, otherprogrammable apparatus or other devices to produce a computerimplemented process such that the instructions which execute on thecomputer or other programmable apparatus provide processes forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks.

FIG. 2 is a configuration of an installer engine in accordance with anillustrative embodiment of the invention. Known installation scriptsoffer little to a person installing a computer program in terms offlexibility. Such installation scripts are made to persist in installingcomputer programs in target systems regardless of conditions that may beinhospitable to the correct installation of the computer program. Acomputer program is a set of instructions readable by a data processingsystem. The instructions may be natively in the form that the computercan process in a processor, in which case the instructions form objectcode. Alternatively, the instructions may be written in a programminglanguage that is readable to people who are trained to edit theprogramming language. This second form of instructions may beinterpreted code. Regardless of the form of the computer program, thecomputer program, when executed, can depend on certain assumptionsconcerning the availability of both hardware and software resources of adata processing system. In other words, a person installing the computerprogram is required to satisfy the assumptions by providing a hospitablehardware and software environment. A hospitable environment is necessaryin order to successfully install the computer program so that allfeatures of the computer program are available to users of the dataprocessing system.

Even in hospitable environments, some steps by prior art installationscripts prove to be redundant, and even harmful, to the currentenvironment. Embodiments, explained below, detect when commands or linesof a script program are about to be performed and skip such lines.

FIG. 2 includes a more specific description of an instance of dataprocessing system 100. The installer engine 205 is program code thatexecutes on operating system 205 a while relying storage 205 b, RAM 205c and CPU or processor 205 d. Installer engine interacts with scriptprogram 201 to parse or otherwise execute commands in preparation forincorporating new features to the data processing system described incomputer program 203. It is appreciated that computer program 203 may betemporarily stored in compressed form to temporarily available storagesuch as a CD-ROM, and the like. In addition, computer program 203 can bemade available in a compressed format or even stored to a remote machinefrom data processing system 100. A script program is a file that isorganized by groups of lines called stanzas. Each line can be formedfrom operating system commands, comments, reserved words or characters,or any combination of these items.

As an alternative to the hardware arrangement of FIG. 2, theinstallation of a computer program to a target computer may beaccomplished by executing the installer engine on a second computer orinstallation computer. An installation computer is a computer that isconfigured to execute the installer engine and perform the steps of thescript program. Accordingly, the installation computer may generateoperating system commands from the script program and transmit theoperating system commands free of any special syntax present in thescript program. Thus, each operating system command can be received bythe target computer, where the operating system command is executednatively according to the operating system syntax and capabilities ofthe target computer. The target computer is the computer that executesthe operating system commands that can be embedded in the installationconfiguration file.

The illustrative embodiments permit a more streamlined installationusing a configuration script. In addition, one or more embodiments maypermit human intervention when an error is detected, without the needfor an operator to manually restart an install script from the beginningStill further, one or more embodiments may permit easy revision to aconfiguration script, for example, by changing an assignment to avariable that may be used to signal or as a criteria for detectingprevious installations of a prerequisite program or data structure.

FIG. 3 is a description of reserved words and allowable commands of aconfiguration script in accordance with an illustrative embodiment ofthe invention. A script program begins with a main stanza that includesat least two lines. These lines are product name line 301 and adescriptor of a first non-main stanza, described in stanza name 303. Themain stanza may also be called a product name stanza, and for humanreadability purposes, uses a name identical to the software product thatis to be installed at the product name line. A configuration script maycontain multiple main stanzas to allow for the installation of more thanone product. A stanza is a grouping of lines with no more than a singlecarriage return or line feed between each. A stanza permits execution ofeach line in sequence, unless excluded by either an operating systemconditional statement or by an ‘installed’ reserved word. Nevertheless,a main stanza can organize subordinate stanzas. As such, at each line ofthe main stanza, a subordinate stanza can be identified, for example, bya product name. Execution and/or parsing of the main stanza may causeexecution to jump, in a manner similar to a function call, to therespective lines of functionality later in the configuration script.Eventually, the subordinate lines of the called stanza complete, andparsing/execution may resume selecting the next stanza in a list ofstanzas identified in the main stanza.

A script program differs from an install script in several ways. At aminimum, the script program can trigger an exit from executing a stanzawhen execution of a line including an operating system command generatesoutput and the line is prefaced by the reserved word “installed”, whileinstall scripts do not feature such an easy cancellation or skipping ofa stanza. Further differences will be apparent in the followingdescription.

The non-main stanzas use descriptors that include a stanza type, and astanza name 303. The stanza name can be arbitrarily selected. However,the stanza type may be one of five types, namely, commands, filesystems, groups, user ids and install, relying on, respectively,reserved words such as commands, filesystems, groups, userids andinstall. Each stanza in the main or product name stanza can be executedin sequence when parsed and executed by the installer engine 205.

Stanza 330 is prefaced by a stanza name and a colon on the first line.Stanza name 331 matches a name present in the main stanza 300.Accordingly, an installer engine may thread execution from a main stanzato each respective stanza. Each stanza can comprise statements that canbe one selected from a group. A first allowable statement is theoperating system command, as modified by a variable, if any 333. Theoperating system command may be an AIX® command, that is, any commandaccording to the syntax of an AIX operating system. AIX is a registeredtrademark of International Business Machines Corp. A second allowablestatement is a PERL-style variable setting 335. A PERL-style variablesetting is the setting of a variable using the syntax rules of the PERLcomputer programming language. A third allowable statement is an errorhandling directive 337. A fourth allowable statement is a comment 339. Afifth allowable statement is an installed test 341. Additional allowablestatement types may also be present in the script program.

Reserved words or characters include equals (“=”) 305, colon (“:”) 307,pound (“#”) 308, as well as the percent (“%”) 309. The percent can be apre-selected prefix character to indicate the presence of a variable,for which substitution with a pre-selected string can be made duringparsing of the script program. The pound can be used, when present asthe first non-whitespace character in a line, as an indication that theline is a comment. “%onerror” is an error handling directive that isfollowed by one of three settings used to instruct the installer enginehow to treat the occurrence of an error by any line of the scriptprogram. Allowed settings can be “stop”, “pause”, and “continue” 311.Operation of the error handling directive is explained further in FIGS.5A-5C, below. In addition, the reserved word “installed” 313 is a signalto the installer engine to parse the remainder of the line as anoperating system command. Any output generated by executing theoperating system command is interpreted by the installer engine to skipthe rest of the stanza in the script program. In other words, thedetermination that output occurred when executing the operating systemcommand causes the installer engine to skip install steps or lines thatremain unprocessed in the stanza where the “installed” line is located.An install step is a line of a script program including characters thatare logically part of the line as coupled through a backslash (‘\’) (seefor example lines 407 and 409, below).

FIGS. 4A and 4B illustrate some of the syntax related to the reservedwords described above. FIG. 4A is an exemplary main grouping of stanzasin accordance with an illustrative embodiment of the invention. Theproduct name is INSTALLDB2 401. The one stanza referenced in the mainstanza is INSTALLORNOT 403, which is an install type of stanza.

FIG. 4B is an exemplary install stanza in accordance with anillustrative embodiment of the invention. The INSTALLORNOT stanza islabeled in a first line 405. A second line 407 is prefaced by thereserved word “installed”, which the installer engine specially treats.The remainder of line 407 is an operating system command. In this case,the operating system command will generate output when a listing of thedirectory “/opt/IBM/db2/V95/install/db21s-c” command returns a match for“9.5” associated with a version of DB2. As such, the installer engineinterprets the presence of output caused by line 407 as indicating thata component or prerequisite software is already installed to the dataprocessing system. Accordingly, a way to detect prior installation of acomputer program is to use an operating system command that filters fortext identical to a version name of the computer program. Alternatively,a search for text identical to a feature name of the program to beinstalled can also signal prior installation when such text is found.

On the other hand, if no output is generated at line 407, the installerengine may continue to further parse and/or execute remaining lines inthe stanza, including line 409. Line 409 may be a line that partly orcompletely results in the installation of a computer program that iseither the computer program that is desired to be installed, or aprerequisite component software on which the target program, forexample, computer program 203 of FIG. 2, depends. A target file is aprerequisite component or data structure that is necessary for completeinstallation of a target program. Other prerequisites to computerprogram installation can include any data structure or setting that isinterdependent with a computer program's execution in a manner toprovide the full functionality associated with the computer program. Aprerequisite to computer program installation can include a file, a userid, a group, or a file system characteristic. A prerequisite file is afile that is a prerequisite to computer program installation.

In the example, configuration installation file of FIGS. 4A and 4B, theline 409, when executed by an installation engine, is an attempt toinstall the computer program. It is appreciated that the use of avariable can be used in place of the “9.5” on line 407 to addflexibility. As such, a variable can define a version of the file,against which a operating system command can compare currently availablefiles. A version of the file is a string identifier of the file used ina file name, or within a data structure of a file.

FIGS. 5A-5C show flowcharts of an installer engine optionally haltingprogress to wait for human remedial action in accordance with anillustrative embodiment of the invention. FIGS. 6A-6C explain, withreference to examples of specific exemplary configuration file lines,the manner that steps in FIGS. 5A-5C are treated for those lines.Initially, a user may trigger execution of the installer engine by thedata processing system. Accordingly, the operating system may receive acommand that invokes the installer engine as well as specifies thescript program. The installer engine then looks up, opens the file, andbegins processing the file line by line either by storing the filecontents to a data structure in memory, or reading each lineincrementally from storage. These steps, together, are steps ofaccessing the script program (step 500). The remaining steps of FIGS.5A-5C are made with reference to the script program specified and openedin this manner. As explained above, the script program may be stored tostorage, see for example, script program 201 of FIG. 2. Next, theinstaller engine sets default settings for handling errors in executinglines in each of the stanzas (step 501). In the example of FIGS. 6A-6Cbelow, no %onerror directive is present. Accordingly, default settingscan be made depending on the type of stanza being processed. Table 1illustrates possible default associations of %ONERROR to each stanzatype.

TABLE 1 Default % onerror setting Type of Stanza for error handlingCommand Continue Filesystem Stop Group Stop Userid Stop Install continue

The installer engine may treat errors arising from stanzas as a stop. Inother words, the detection of errors, by default, will cause theinstaller engine to stop parsing and executing the script program. Onthe other hand, the installer engine may treat errors in stanzas oftypes “command” and “install” as, by default, using the “continue” errorhandling directive. An error handling directive is an indication thatdefines how to treat errors, for example, “stop”, “continue” or “pause”.Accordingly, processing of the stanza by the installer engine willcontinue after the error without pausing or stopping. The installerengine iterates parsing through lines of the stanza (step 503). Next,the installer engine may parse an error handling directive (%onerror),if present, for a system response to an error (step 505). Accordingly,the installer engine sets the error handling directive to “stop”,“continue” or “pause” per the script program. Such a setting mayoverride the handling of errors as established in step 501.

The lines of the script program can be directed to forming file systems,user ids, groups or other subjects including the copying of files to thefile system. For each line, the installer engine may make variablesubstitutions when a variable is detected (step 506). Detection includessearching for a pre-selected prefix character, as described in FIG. 3,prefix character 309.

A line of an installation configuration file script can be of varyingtypes. Some lines define installer directives. Some lines are purelyoperating system commands. Other lines can be both operating systemcommands, but more specifically, are directed to installation phasesrelated to groups, userids and filesystems. Accordingly, depending onthe syntax of the line, and sometimes, the stanza in which a lineappears, different branches of processing occur with respect to theline. Accordingly, FIG. 5A splits after step 506, depending on thecontent of the line of the script program.

Accordingly, the installer engine may have built-in directives (step509) that may be prepared to detect the presence of a file or any otherdata structure that might signal that at least one component orprerequisite data structure is already present or needs to beconfigured. Thus, the installer engine determines whether a component orprerequisite data structure is present. Components can include a file,or an amount of disk space, or other similar resources. Line 610 of FIG.6A is an example of such an installer defined directive. Such a step isperformed by executing a conditional statement using a scriptinglanguage of the operating system. As a way to prepare installation, theinstaller engine obtains or otherwise verifies adequate storage (step510). Adequate storage is a predetermined amount of storage establishedby developers of the computer program to allow dynamic storage duringcomputer program execution as well as a sufficient storage toaccommodate growth of data structures used long term. Accordingly, theinstaller engine adds additional storage in case adequate storage isunavailable, for example, by including an operating system command and areference to a file system and quantity of storage space. Next, theinstaller engine creates commands for a script, and as needed, executethose commands (step 511).

In an alternative step after step 506, the installer engine may receivedefinitions of users, groups, or filesystems (step 520). Next, theinstaller engine determines if creation or modification of a user,group, or filesystem is necessary (step 517). If a creation ormodification is necessary, the installer engine will generate theappropriate commands. The commands can be one selected to create ormodify a group (step 517A). A group is a set of userids, which may be anempty set. The commands may be to create or modify a userid (step 517B).A userid is an account associated with a single user, based on the userpresenting correct credentials at login time. A user account command isany command that accesses, deletes or creates a userid. A create useraccount command creates a user account in response to execution in adata processing system. The user account includes at least a user name,a password, and a definition of permitted access rights. The commandsmay be to access, create, or modify a file system (or filesystem) (step517C). A file system that is a target of the script program is a filesystem specified in the command to access, create, or modify the filesystem, using conventional naming techniques of the operating systemthat hosts the installer engine. If the commands modify the userid thatis executing the installer engine and the modifications cannot bedynamically applied to the running userid, the installer engine willexit with appropriate messages. In the cases of commands for group step517A, userid step 517B and filesystem step 517C, the installer enginenext executes step 519 of FIG. 5B.

If the command is listed under a command stanza of the script program,the installer engine executes the stanza line as an operating systemcommand (step 508). An operating system command is a command accessiblefrom the command line of a computer hosting an operating system. Anoperating system command can be, for example, a command to listinstalled programs in a target computer. An operating system command canbe a command to perform a search for a regular expression. Operatingsystem commands can be used multiple times per line. However, if thecommand is a command from an install stanza type, the installer enginenext executes step 571 of FIG. 5C.

FIG. 5C follows step 506 in the case of an install stanza with parsingscript program line (step 571). Next, the installer engine may determineif the line includes the “installed” keyword (step 573). The presence ofthe installed keyword indicates that the line or stanza is programmed toinitiate installation. In the case of the “installed” keyword beingpresent, the installer engine executes the remainder of the line as anoperating system command (step 581). Next, the installer enginedetermines whether the operating system command produces output (step583). A positive evaluation is a determination that an operating systemcommand produces output. If so, the installer engine skips the remainingsteps in the stanza (step 585). The operating system command can be anyconventional command according to the syntax of the operating system.Such commands are chosen by the author of the script program to locateindications that a program is installed or a data structure is set up asif the program is installed. Accordingly, one way that an operatingsystem command produces output is searching for program names thatinclude a version number, for example, by searching all files in thetarget install directory for a version number. A search can be conductedusing search commands such as sed, awk, grep, and the like. Accordingly,step 583 can be read from the script program and sent to the operatingsystem. The installer engine waits for the operating system to completethe command. If the command produces output, all unprocessed lines inthe stanza are skipped per step 585. Conversely, if no output occurs(e.g. grep finds no match to the version), a next line in the stanza is,for example, read from the installation configuration file, andprocessed per step 503. Accordingly, the outcome of step 583 determineswhether a next line or stanza is, in one case, executed to attempt toinstall the computer program or, in another case, skipped. A negativeevaluation is a determination that the operating system command producesno output.

Following negative results at step 573, the installer engine executesthe stanza line as an operating system command (step 587).

FIG. 5B shows steps that following results at step 508, 511, 517, or587. Accordingly, the installer engine determines whether the lastcommand produced an error (step 519). If an error occurred, theinstaller engine may determine if a continue on error directive had beenmade in one of the lines of the script program (step 521). If there wassuch a directive, the installer engine continues as normal (step 503).If no further lines are available, execution terminates. No furtherlines exist if there is a blank line following a last line of a mainstanza.

However, if a continue on error directive was not present (or otherdirective present that indicates need for user response), executioncontinues from step 521 to cause the installer engine to determinewhether a stop directive had been set (step 522). If so, processingterminates. Otherwise, the installer engine determines whether a pausedirective had been set (step 523). If not, then the installer enginecontinues to step 503 and continues further if more lines are present inthe script program.

However, if the installer engine determines a pause directive had beenset, the installer engine waits to receive a user response. Accordingly,the installer engine may determine if the user response is to continue(step 531). The user response of “continue” may be an indication fromthe user that remedial steps are complete. Remedial steps can includechanging permissions to a directory or file, among others. Accordingly,the user response can be a keyboard entry that indicates that a remedyis complete, at least complete from the perspective of the user.Following a user response of “continue”, such as may occur when aninstaller investigates the cause of error and remedies the error, theinstaller engine may resume at step 503. In other words, the installerengine processes a next line of the script program. A next line is aline that appears below the currently executed line, but is not coupledto the currently executed line through a backslash (‘\’), nor isprefaced by the comment character, pound (“#”). However, if thedetermination is that the user has not indicated “continue”, processingmay terminate.

FIGS. 6A-6C are examples of script programs that are interpreted, forexample, according to flowcharts of FIGS. 5A-5C. The main stanza 650 isprefaced by the line “DB2:”. The script program does not expressly set%onerror. Accordingly, the installer engine relies on default settingsof %onerror for each stanza type, for example, as set forth in Table 1,above. Accordingly, the setting of %onerror defaults may occur before orduring the parsing of the first line 600 of the main stanza. Inaddition, variable settings may be triggered in response to theinstaller engine referencing the first line of the main stanza 600 andinterpreting that a first called stanza is the one labeled VARS 601.

Accordingly, the first line of VARS stanza is parsed, in this case, withthe prefix of ‘%’ which indicates a variable assignment. The installerengine interprets “%DB2VG=db2vg” 602 to indicate that the variable%DB2VG is assigned the string db2vg. The installer engine processes theremaining lines of VARS stanza until it reaches a blank line 629. Afterthat, the installer engine resumes a next line in the main stanza,namely filesystems=DB2FS 691.

Processing eventually reaches the first line of DB2FS stanza, namelyvg=%DB2VG 605. The installer engine performs a volume group command atthis line, and in the remaining lines of this stanza. Further lines,such as line 617C, may be processed by the installer engine, forexample, as described in step 517C of FIG. 5A. In the example of line617C, the file system that is a target of the script program is/db2home. The installer engine processes the remainder of the DB2FSstanza, including the minfree directive 610 as described in steps 509,510, and 511 of FIG. 5A. The installer engine can continue parsing linesand reach a first line of a userid stanza, namely line 617B. Line 617Bmay be processed according to step 517B of FIG. 5A.

FIG. 6B shows the continuation of the script program. DB2PRE is a stanzaof a command type. Accordingly, command 617 is processed as an operatingsystem command. In contrast, DB2PRODUCT is a stanza of type installtype. Accordingly, line 617D is treated according to the “D” branch ofstep 517 of FIG. 5A, and further processed according to the steps of571, and others, of FIG. 5C.

Conditional execution of a line may be determined by the installerengine parsing and otherwise processing line 673A. The line following“INSTALLED” is executed as an operating system command. Accordingly, theline 673A produces no output. The installer engine can continue toprocess line 673B, per the steps following step 573 in FIG. 5C. In theexample line 673A, the operating system command includes a command tosearch for a version identifier of the program to be installed, in thiscase “9.5”. Multiple commands may be piped (‘|’) together so that outputof one command is further processed by another operating system command.A final command in such a pipeline, for example ‘grep’, generatesoutput, if any, to the invoking application, in this case, the installerengine. Although the operating system commands described here are shownas examples, it is appreciated that other operating system commands canbe used. For example, an operating system command can be a commandexecutable at a command line of an operating system.

FIG. 6C shows the continuation of the script program example, FIG. 6Aabove, and shows the remaining lines of the DB2PRODUCT stanza.

The illustrative embodiments permit flexible execution of a scriptprogram in a manner to make the file, when operated by an installerengine, recover from errors occurring in individual step execution whilepermitting execution to resume at the point of error following a userintervention. In addition, some illustrative embodiments mayintelligently refrain or skip installing or otherwise setting up datastructures, that though required, are already present in one or moretarget data processing systems. Accordingly, fewer errors may occur, andgreater speed can be obtained, among other benefits.

The illustrative embodiments are described relative to install commandsof at least the AIX® operating system. AIX is a registered trademark ofInternational Business Machines Corp. It is appreciated that installcommands and operations of the data processing system may rely on anyoperating system as an interpreter for operating system commands. Thescope of the invention includes other operating systems, for example,Unix®, Linux™, as well as other operating system shells. UNIX is aregistered trademark of The Open Group. Linux is a trademark of LinusTorvalds.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof code, which comprises one or more executable instructions forimplementing the specified logical function(s). It should also be notedthat, in some alternative implementations, the functions noted in theblock may occur out of the order noted in the figures. For example, twoblocks shown in succession may, in fact be executed substantiallyconcurrently, or the blocks may sometimes be executed in the reverseorder, depending upon the functionality involved. It will also be notedthat each block of the block diagrams and/or flowchart illustration, andcombinations of blocks in the block diagrams and/or flowchartillustration, can be implemented by special purpose hardware-basedsystems that perform the specified functions or acts, or combinations ofspecial purpose hardware and computer instructions.

The invention can take the form of an entirely hardware embodiment, anentirely software embodiment or an embodiment containing both hardwareand software elements. In a preferred embodiment, the invention isimplemented in software, which includes but is not limited to firmware,resident software, microcode, etc.

Furthermore, the invention can take the form of a computer programproduct accessible from a computer-usable or computer-readable deviceproviding program code for use by or in connection with a computer orany instruction execution system. For the purposes of this description,a computer-usable or computer readable device can be any tangibleapparatus that can store the program for use by or in connection withthe instruction execution system, apparatus, or device.

A data processing system suitable for storing and/or executing programcode will include at least one processor coupled directly or indirectlyto memory elements through a system bus. The memory elements can includelocal memory employed during actual execution of the program code, bulkstorage, and cache memories, which provide temporary storage of at leastsome program code in order to reduce the number of times code must beretrieved from bulk storage during execution.

Input/output or I/O devices (including but not limited to keyboards,displays, pointing devices, etc.) can be coupled to the system eitherdirectly or through intervening I/O controllers.

Network adapters may also be coupled to the system to enable the dataprocessing system to become coupled to other data processing systems orremote printers or computer readable tangible storage devices throughintervening private or public networks. Modems, cable modem and Ethernetcards are just a few of the currently available types of networkadapters.

The description of the present invention has been presented for purposesof illustration and description, and is not intended to be exhaustive orlimited to the invention in the form disclosed. Many modifications andvariations will be apparent to those of ordinary skill in the art. Theembodiment was chosen and described in order to best explain theprinciples of the invention, the practical application, and to enableothers of ordinary skill in the art to understand the invention forvarious embodiments with various modifications as are suited to theparticular use contemplated.

What is claimed is:
 1. A computer program product for controllingexecution of a script program including a stanza to direct installationof a first version of a computer program in a target computer, thecomputer program product comprising: one or more computer-readablestorage devices; the script program stored on one of the storagedevices; program instructions, stored on at least one of the one or morestorage devices as an installation program separate from the scriptprogram and separate from the computer program, to begin to execute aline of code in a beginning part of the stanza of the script program,the line including a non-alphanumeric character which directs theinstallation program computer to parse a remainder of the line as acommand to an operating system in the target computer, the commandrequesting the operating system to determine if the first version of thecomputer program is already installed in the target computer bysearching within at least one directory of the target computer for aname of the first version of the computer program or for a programfeature of the first version of the computer program that does notappear within any other versions of the computer program or in a name ofany version of the computer program, wherein the command to theoperating system filters for text identical to the name of the programfeature, and determine from a response of the operating system to thecommand whether the first version of the computer program is alreadyinstalled in the target computer, and, if so, the installation programmodifies the script program during execution of the script program toskip a remainder of the stanza of the script program to avoidre-installation of the first version of the computer program in thetarget computer, and if not, the installation program executes theremainder of the stanza of the script program to direct installation ofthe first version of the computer program in the target computer and toparse a command to create a user account, and in response, to create auser account specified in the command to create the user account.
 2. Thecomputer program product of claim 1, wherein the command to theoperating system filters for a regular expression name of the programfeature.
 3. The computer program product of claim 1, wherein the targetcomputer is not the same as the installation program computer.
 4. A dataprocessing system for controlling execution of a script programincluding a stanza to direct installation of a first version of acomputer program in a target computer, the data processing systemcomprising: one or more processors, one or more computer-readablememories and one or more computer-readable storage devices; programinstructions, stored on at least one of the one or more storage devicesfor execution as an installation program, which is separate from thescript program and separate from the computer program, by at least oneof the one or more processors via at least one of the one or morememories, to begin to execute a line of code in a beginning part of thestanza of the script program, the line including a non-alphanumericcharacter which directs the installation program computer to parse aremainder of the line as a command to an operating system in the targetcomputer, the command requesting the operating system to determine ifthe first version of the computer program is already installed in thetarget computer by searching within at least one directory of the targetcomputer for a name of the first version of the computer program or fora program feature of the first version of the computer program that doesnot appear within any other versions of the computer program or in aname of any version of the computer program, wherein the command to theoperating system filters for text identical to the name of the programfeature, and determine from a response of the operating system to thecommand whether the first version of the computer program is alreadyinstalled in the target computer, and, if so, the installation programmodifies the script program during execution of the script program toskip a remainder of the stanza of the script program to avoidre-installation of the first version of the computer program in thetarget computer, and if not, the installation program execute theremainder of the stanza of the script program to direct installation ofthe first version of the computer program in the target computer and toparse a command to create a user account, and in response, to create auser account specified in the command to create the user account.
 5. Thedata processing system of claim 4, wherein the command to the operatingsystem filters for a regular expression of the program feature.
 6. Thecomputer program product of claim 1 further comprising programinstructions, stored on at least one of the one or more storage devices,to identify the remainder of the stanza from a pre-determined format ofthe stanza indicating an end of the stanza and a beginning of a nextstanza in the script program, and to skip the remainder of the stanzawhich avoids re-installation of the computer program in the targetcomputer to execute the next stanza in the script program.
 7. The dataprocessing system of claim 4 further comprise program instructions,stored on at least one of the one or more storage devices for executionby at least one of the one or more processors via at least one of theone or more memories, to identify the remainder of the stanza from apre-determined format of the stanza indicating an end of the stanza anda beginning of a next stanza in the script program, and to skip theremainder of the stanza which avoids re-installation of the computerprogram in the target computer to execute the next stanza in the scriptprogram.
 8. The computer program product of claim 1, wherein a name ofthe program feature is generated by the operating system commandtargeting the first version of the computer program, wherein the name ofthe program feature does not appear as output generated by the commandto the operating system when used to target any other version of thecomputer program.
 9. The data processing system of claim 4, wherein thename of a program feature is generated by the operating system commandtargeting the first version of the computer program, wherein the name ofthe program feature does not appear as output generated by the commandto the operating system when used to target any other version of thecomputer program.